package com.gz;
import java.util.*;
import com.sun.java.swing.plaf.windows.WindowsInternalFrameTitlePane;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
@SuppressWarnings({"all"})
public class Test {
    public static void main(String[] args) {
        HashSet hashSet= new HashSet();
        hashSet.add(new Employee("gz",20000, new birthday(2002,10,18)));
        hashSet.add(new Employee("hh",20000, new birthday(2000,10,18)));
        hashSet.add(new Employee("gz",20000, new birthday(2002,10,18)));
        System.out.println("set: "+hashSet);
    }
}

class Employee{
    public Employee(String name,double salary,birthday b) {
        this.name = name;
        this.b = b;
        this.salary = salary;
    }

    private String name;
    private double salary;
    private birthday b;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Employee employee = (Employee) o;
        return Objects.equals(name, employee.name) && Objects.equals(b, employee.b);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, b);
    }

    @Override
    public String toString() {
        return "Employee{" +
                "name='" + name + '\'' +
                ", salary=" + salary +
                ", b=" + b +
                "}\n";
    }
}
class birthday{
    private int year;
    private int month;
    private int day;

    public birthday(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        birthday birthday = (birthday) o;
        return year == birthday.year && month == birthday.month && day == birthday.day;
    }

    @Override
    public int hashCode() {
        return Objects.hash(year, month, day);
    }

    @Override
    public String toString() {
        return "birthday{" +
                "year=" + year +
                ", month=" + month +
                ", day=" + day +
                '}';
    }
}